import fetch from 'common/src/utils/fetch';
/**
 * 获取可录入成绩的课程列表
 * @param {*} data
 */
function queryScoreEnterInfoList(data = {}) {
    return fetch({
        method: 'post',
        url: '/api/scoremanagementservice/enterScoreController/queryScoreEnterInfoList',
        data
    });
}

/**
 * 获取shijianke可录入成绩的课程列表
 * @param {*} data
 */
function selectPracticeCourseList(data = {}) {
    return fetch({
        method: 'post',
        url: '/api/scoremanagementservice/scoreManageController/selectPracticeCourseList',
        data
    });
}

/**
 * 可录入时间范围设置数据
 * @param {*} data
 */
function queryScoreEnterConfigInfo(data = {}) {
    return fetch({
        method: 'post',
        url: '/api/scoremanagementservice/enterScoreController/queryScoreEnterConfigInfo',
        data
    });
}

/**
 * 根据管理部门获取全局设置信息
 * @param {*} data
 */
function queryScoreGlobalInfo(data = {}) {
    return fetch({
        method: 'post',
        url: '/api/scoremanagementservice/enterScoreController/queryScoreGlobalInfo',
        data
    });
}

/**
 * 获取成绩构成信息
 * @param {*} data
 */
function initTeachingclassInfo(data = {}) {
    return fetch({
        method: 'post',
        url: '/api/scoremanagementservice/enterScoreController/initTeachingclassInfo',
        data
    });
}
//获取重缓考成绩构成
function getReScoreListInfo(data) {
    return fetch({
        url: '/api/scoremanagementservice/scoreManageController/getScoreComposition',
        method: 'post',
        data
    })
}
/**
 * 保存成绩构成
 * @param {*} data
 */
function saveScoreStructureInfo(data) {
    return fetch({
        method: 'post',
        url: '/api/scoremanagementservice/enterScoreController/saveScoreStructureInfo',
        data
    });
}

/**
 * 获取成绩录入list页面基础信息
 * @param {*} data
 */
function initEnterScoreStudentList(data) {
    return fetch({
        method: 'post',
        url: '/api/scoremanagementservice/enterScoreController/initEnterScoreStudentList',
        data
    });
}

function queryScoreRecordList(data) {
    return fetch({
        method: 'post',
        url: '/api/scoremanagementservice/scoreSettingController/queryScoreRecordList',
        data
    });
}

/**
 * 给老师发送短信
 * @param {} data
 */
function enterVerification(calendarId, courseCode, examType, enterableType) {
    return fetch({
        method: 'get',
        url: '/api/scoremanagementservice/enterScoreController/enterVerification?courseCode=' + courseCode + '&calendarId=' + calendarId + '&examType=' + examType + '&enterableType=' + enterableType
    });
}

/**
 * 验证成绩录入时间
 * @param {} data
 */
function sendSms(data) {
    return fetch({
        method: 'post',
        url: '/api/scoremanagementservice/enterScoreController/sendSms',
        data
    });
}

/**
 * 短信验证
 * @param {} data
 */
function validationSms(data) {
    return fetch({
        method: 'post',
        url: '/api/scoremanagementservice/enterScoreController/validationSms',
        data
    });
}
function getScopeTypeList(data) {
    return fetch({
        url: '/api/scoremanagementservice/scoreSettingController/queryScoreRecord?coretypeCode=' + data + '&projectId=1',
        method: 'get'
    })
}

function deleteStudentScore(data) {
    return fetch({
        url: `/api/scoremanagementservice/enterScoreController/deleteStudentScore?teachingClassId=${data.teachingClassId}&calendarId=${data.calendarId}&examType=${data.examType}`,
        method: 'delete'
    })
}
function deleteSlowStudentScore(data) {
    return fetch({
        url: `/api/scoremanagementservice/enterScoreController/deleteSlowStudentScore?teachingClassId=${data.teachingClassId}&calendarId=${data.calendarId}&examType=${data.examType}`,
        method: 'delete'
    })
}

function getUnlock(data) {
    return fetch({
        url: `/api/scoremanagementservice/paperAnalysisController/getUnlock?courseCode=${data.courseCode}&calendarId=${data.calendarId}&teachingClassId=${data.teachingClassId}`,
        method: 'get'
    })
}
export default {
    queryScoreEnterInfoList,
    queryScoreEnterConfigInfo,
    initTeachingclassInfo,
    queryScoreGlobalInfo,
    saveScoreStructureInfo,
    initEnterScoreStudentList,
    queryScoreRecordList,
    sendSms,
    validationSms,
    enterVerification,
    selectPracticeCourseList,
    getReScoreListInfo,
    getScopeTypeList,
    deleteStudentScore,
    deleteSlowStudentScore,
    getUnlock
};
